package com.it.web;

import com.it.pojo.Account;
import com.it.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping("query")
    @ResponseBody
    public List<Account> queryAll() {
       /* Account account = new Account();
        account.setId(1);
        account.setName("xiaoxin");
        account.setMoney(300F);*/

        /*accountService.queryAll()*/;//注入父容器后
        return accountService.queryAll();
    }


}
